//
// Decompiled by Jadx - 376ms
//
package me.plusne.GreenDao.dao;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import androidx.activity.b;
import fm.c;
import x.a;
import x.d;

public final class ConfigDao extends a<c, Long> {
    public static final String TABLENAME = "CONFIG";

    public class Properties {
        public static final d Id = new d(0, Long.class, "id", true, "_id");
        public static final d Key = new d(1, String.class, "key", false, "KEY");
        public static final d Value = new d(2, String.class, "value", false, "VALUE");
        public static final d Type = new d(3, String.class, "type", false, "TYPE");
    }

    public ConfigDao(g.a aVar) {
        super(aVar);
    }

    public static void createTable(org.greenrobot.greendao.database.Database aVar, boolean z) {
        String str;
        if (z) {
            str = "IF NOT EXISTS ";
        } else {
            str = "";
        }
        aVar.d("CREATE TABLE " + str + "\"CONFIG\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"KEY\" TEXT,\"VALUE\" TEXT,\"TYPE\" TEXT);");
        b.v(new StringBuilder("CREATE INDEX "), str, "idKey ON \"CONFIG\" (\"KEY\" ASC);", aVar);
    }

    public static void dropTable(org.greenrobot.greendao.database.Database aVar, boolean z) {
        String str;
        StringBuilder sb = new StringBuilder("DROP TABLE ");
        if (z) {
            str = "IF EXISTS ";
        } else {
            str = "";
        }
        b.v(sb, str, "\"CONFIG\"", aVar);
    }

    public final void a(SQLiteStatement sQLiteStatement, Object obj) {
        c cVar = (c) obj;
        sQLiteStatement.clearBindings();
        Long l = cVar.a;
        if (l != null) {
            sQLiteStatement.bindLong(1, l.longValue());
        }
        String str = cVar.b;
        if (str != null) {
            sQLiteStatement.bindString(2, str);
        }
        String str2 = cVar.c;
        if (str2 != null) {
            sQLiteStatement.bindString(3, str2);
        }
        String str3 = cVar.d;
        if (str3 != null) {
            sQLiteStatement.bindString(4, str3);
        }
    }

    public final void b(Object obj, org.greenrobot.greendao.database.c cVar) {
        c cVar2 = (c) obj;
        cVar.k();
        Long l = cVar2.a;
        if (l != null) {
            cVar.j(1, l.longValue());
        }
        String str = cVar2.b;
        if (str != null) {
            cVar.i(2, str);
        }
        String str2 = cVar2.c;
        if (str2 != null) {
            cVar.i(3, str2);
        }
        String str3 = cVar2.d;
        if (str3 != null) {
            cVar.i(4, str3);
        }
    }

    public final Long c(Object obj) {
        c cVar = (c) obj;
        if (cVar != null) {
            return cVar.a;
        }
        return null;
    }

    public final Object d(Cursor cursor) {
        return new c(cursor.isNull(0) ? null : Long.valueOf(cursor.getLong(0)), cursor.isNull(1) ? null : cursor.getString(1), cursor.isNull(2) ? null : cursor.getString(2), cursor.isNull(3) ? null : cursor.getString(3));
    }

    public final Long e(Cursor cursor) {
        if (cursor.isNull(0)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(0));
    }

    public final Long f(long j, Object obj) {
        ((c) obj).a = Long.valueOf(j);
        return Long.valueOf(j);
    }
}
